import {
	Api
} from '@/common/api'
import {
	ApiBase
} from '@/common/api-base.js';

class LoginClass extends ApiBase {
	login(username, password) {
		return Api.post(`${this._namespace}/login`, {
			username,
			password,
		}, {
			isToken: false
		});
	}
	getDict(mType) {
		return Api.get(`${this._namespace}/system/h5/dict/data/type/${mType}`,);
	}
	getInfo() {
		return Api.get(`${this._namespace}/getInfo`,);
	}
	logout() {
		return Api.post(`${this._namespace}/logout`,);
	}
	getCodeImg() {
		return Api.get(`${this._namespace}/captchaImage`, {
			isToken: false, timeout: 20000
		});
	}
	getVisitStatus(idNum, hospitalId, type) {
		return Api.get(`${this._namespace}/system/h5/visit/patient/${idNum}/${hospitalId}/${type}`,);
	}
	getVisitInfo(visitId) {
		return Api.get(`${this._namespace}/system/h5/visit/${visitId}`,);
	}
	updateVisitInfo(data) {
		return Api.put(`${this._namespace}/system/h5/visit`, data);
	}
	getAllHospital() {
		return Api.get(`${this._namespace}/system/h5/visit/getAllHospital`,);
	}

}

export const LoginApi = new LoginClass('')
